package text_2023_09_30;

/**
 * @author Vv
 * @version 1.0
 * @project coding_learn
 * @description
 * @date 2023/9/30 16:57:16
 */

class ThreadTestr extends Thread{
    public void run(){
        for(int i=0;i<10;i++){
            System.out.println(this.getName() + ":" + i);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}

public class Demo1 {

    public static void main(String[] args) {
        ThreadTestr tt = new ThreadTestr();
        tt.start();
        try {
            tt.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        for(int i=0;i<10;i++){
            System.out.println("main:" + i);
        }

    }
}
